package com.hucii.app.view;

import android.content.Context;
import android.util.AttributeSet;
import android.webkit.WebSettings;
import android.webkit.WebSettings.RenderPriority;
import android.webkit.WebView;


public class MyWebView extends WebView {
	Context mContext;

	public MyWebView(Context context) {
		super(context);
		this.mContext = context;
		init();
	}

	public MyWebView(Context context, AttributeSet attrs) {
		super(context, attrs);
		this.mContext = context;
		init();
	}

	public MyWebView(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
		this.mContext = context;
		init();
	}

	private void init() {
		setScrollBarStyle(0);//设置滚动条的宽度
		WebSettings webSettings = getSettings();
		webSettings.setJavaScriptEnabled(true);//支持js脚本
		webSettings.setSaveFormData(false);//是否保存表单数据
		webSettings.setSavePassword(false);//是否保存密码
		webSettings.setSupportZoom(false);//是否支持缩放
		webSettings.setRenderPriority(RenderPriority.HIGH);//提高渲染的优先级
//		webSettings.setBlockNetworkImage(true);//把图片加载放在最后来加载渲染
	}

	@Override
	public void loadUrl(String url) {

//		if (StringUtils.isNullOrEmpty(url)) {
//			return;
//		}
//		UtilsLog.e("url", url);
		super.loadUrl(url);
	}

}
